#pragma  once
#include "pde_export.h"
#include "pdeLut.h"
#include "pdeVolume.h"
#include "pdePlan.h"
#include "pdeStructSet.h"
#include "pdeDoseModel.h"
#include "pdeRBE.h"
#include "glm/vec4.hpp"
#include "glm/vec3.hpp"


namespace pde {

	int pde_export optimize_plan(std::shared_ptr<Nozzle> nozzle,
		std::shared_ptr<VolumeShort> ct,
		std::shared_ptr<Lut> lut,
		std::vector<std::shared_ptr<Roi>> roi_list,
		std::shared_ptr<Plan> plan,
		std::shared_ptr<VolumeFloat> dose);

	int pde_export calculate_layers(std::shared_ptr<Nozzle> nozzle,
		std::shared_ptr<VolumeShort> ct,
		std::shared_ptr<Lut> lut,
		std::vector<std::shared_ptr<Roi>> roi_list,
		std::shared_ptr<Plan> plan);

	//dose_engine: 0:pencil beam, 1:monte carlo
	 int pde_export  calculate_final_dose(std::shared_ptr<Nozzle> nozzle,
		std::shared_ptr<VolumeShort> ct,
		std::shared_ptr<Lut> lut,
		std::shared_ptr<Plan> plan,
		std::shared_ptr<VolumeFloat> dose_phy,
		std::shared_ptr<VolumeFloat> dose_rbe,
		std::shared_ptr<VolumeFloat> dose_let,
		std::shared_ptr<RbeModel> rbe_model, int dose_engine=0); 

	 int pde_export  calculate_idd(std::shared_ptr<Nozzle> nozzle,
		std::shared_ptr<VolumeShort> ct,
		std::shared_ptr<Lut> lut,
		std::shared_ptr<DoseModel> dose_model,
		std::shared_ptr<DoseCurve> curve);


	 std::vector<double> pde_export calculate_air_profile_sigma(std::shared_ptr<DoseModel> dose_model, const std::vector <double>& z_list);

	int pde_export  collision_check(std::shared_ptr<Nozzle> nozzle,
		std::shared_ptr<VolumeShort> ct, 
		float gantry_angle, 
		float couch_angle, 
		glm::dvec3 iso_center, 
		float air_gap);
}
